<?php

class tablaMaestra_model extends CI_Model {

    public function list_TM_Log($parametros) {
        $sql = "call sp_Combo(?,?)";
        $query = $this->db->query($sql, $parametros);
        if ($query->num_rows() > 0) {
            foreach ($query->result() as $fila) :
                $data[] = $fila;
            endforeach;
        }else {
            $data = null;
        }
        return $data;
    }

    public function listarLogTMxCod($params) {
        $query = $this->db->query('call sp_ListarLogTMxCodigo(?,?)', $params);
        return $query->result();
    }

    public function IU_TM_Log($params) {
        $sql = "call sp_IULogTM(?,?,?,?)";
        $this->db->query($sql, $params);
    }

    public function ultimoCodigo($params) {
        $sql = "call sp_obtenerUltimoCodigo(?,?)";
        return $this->db->query($sql, $params);
    }

}

?>
